package com.test.marsCode;

/**
 * @author sujiafa
 * @date 2025/1/23
 */
public class n1_找单独的数 {

    public static int solution(int[] cards) {
        // Edit your code here
        int result = cards[0];
        for (int i = 1; i < cards.length; i++) {
            result = result ^ cards[i];
        }
        return result;
    }

    public static void main(String[] args) {
        // Add your test cases here
        System.out.println(solution(new int[]{1, 1, 2, 2, 3, 3, 4, 5, 5}) == 4);
        System.out.println(solution(new int[]{0, 1, 0, 1, 2}) == 2);
    }
}
